﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KalevaAalto.Async.Interfaces
{
    public interface ICreateAsync<T> where T : class, ICreateAsync<T>
    {
        Task<T> InitAsync();

        static async Task<T> CreateAsync(Func<T> func)
        {
            var value = func();
            await value.InitAsync();
            return value;
        }
    }
}
